<template>
  <div>{{ test }}</div>
  <button @click="toClick">点击</button>
</template>

<script>
import { reactive, toRefs } from 'vue'
export default {
  name: 'App',
  setup () {
    const state = reactive({
      test: '测试'
    })

    const toClick = () => {
      console.log('我是一个标识', state.test)
    }

    return {
      ...toRefs(state),
      toClick
    }
  }
}
</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
